package com.centaline.androidsalesblog.model.businissobject;

import com.centaline.androidsalesblog.model.databaseobject.PostDo;

import java.util.ArrayList;

/**
 * 未约看父级
 * Created by guilin on 16/4/23.
 */
public class ReservationParentBo {

    private int status;//0:普通状态;1:下架状态
    private String estateCode;//小区code
    private String estateName;//小区名称
    private boolean check;
    private ArrayList<PostDo> postDoArrayList;
    private ArrayList<Boolean> checkList;

    public ReservationParentBo(int status, String estateCode, String estateName) {
        this.status = status;
        this.estateCode = estateCode;
        this.estateName = estateName;
        postDoArrayList = new ArrayList<>();
        checkList = new ArrayList<>();
    }

    public void add(PostDo postDo) {
        postDoArrayList.add(postDo);
    }

    public void add(int index, PostDo postDo) {
        postDoArrayList.add(index, postDo);
    }

    public void addCheck(boolean check) {
        checkList.add(check);
    }

    public void setCheck(boolean check) {
        this.check = check;
    }

    /**
     * 更新所有状态
     */
    public void notifyCheckList(boolean isChecked) {
        int size = checkList.size();
        checkList.clear();
        for (int i = 0; i < size; i++) {
            checkList.add(isChecked);
        }
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    public String getEstateCode() {
        return estateCode;
    }

    public String getEstateName() {
        return estateName;
    }

    public boolean isCheck() {
        return check;
    }

    public ArrayList<PostDo> getPostDoArrayList() {
        return postDoArrayList;
    }

    public ArrayList<Boolean> getCheckList() {
        return checkList;
    }
}
